<template>
  <div id="headerOne"  @mouseleave="mouseLeave" :class="[Now == 2 ? 'white':'notWhite']">
    <div class="headerOne">
      <div class="logo">
        <!-- <img src="" alt="">  :style="{backgroundImage: 'url('+ (coverImgUrl ? logoTwo : logoOne)+')'}"-->
        <router-link to="/" :class="[Now == 2 ? 'logoTwo' : 'logoOne']"></router-link>
      </div>
      <div class="rightMenu" @mouseover="mouseOver">
        <span :style="{color:(Now == 2 ? '#000':'#FFF')}">MENU</span>
        <!-- <img src="" alt=""> -->
        <i  :class="[Now == 2 ? 'MenuTwo' : 'MenuOne']"></i>
      </div>
      <div class="nav" v-if="Now == 2">
        <ul>
          <li v-for="(item, index) in navList" :key="index">
            <router-link :to="{ path: item.url }">
              {{ item.title }}
            </router-link>
            <ul>
              <li v-for="(child, index) in item.children" :key="index">
                <router-link :to="{ path: child.url }">
                  {{ child.title }}
                </router-link>
              </li>
            </ul>
          </li>
          <li>
            <p>服务热线:<span>400-668-6008</span></p>
            <p>合作热线:<span>0755-82181008</span></p>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "headerOne",
  data() {
    return {
      Now:1,
      // logoOne: require("../assets/new_bg.svg"),
      // logoTwo: require("../assets/new_bg.svg"),
      navList: [
        {
          name: "",
          url: "/center",
          title: "产品中心",
          children: [
            {
              name: "",
              url: "/center",
              title: "车险",
            },
            {
              name: "",
              url: "/center",
              title: "财产险",
            },
            {
              name: "",
              url: "/center",
              title: "责任险",
            },
            {
              name: "",
              url: "/center",
              title: "意外险",
            },
            {
              name: "",
              url: "/center",
              title: "工程险",
            },
            {
              name: "",
              url: "/center",
              title: "特色险",
            },
          ],
        },
        {
          name: "",
          url: "/Information",
          title: "行业资讯",
        },
        {
          name: "",
          url: "/us",
          title: "关于我们",
        },
        // {
        //   name:'',
        //   url: "/industry",
        //   title: "产业事业部",
        // },
        // // {
        // //   url: "/design",
        // //   title: "柏瑞设计",
        // // },
        // {
        //   name:'',
        //   url: "/about",
        //   title: "关于我们",
        // },
        // {
        //   name:'',
        //   url: "/us",
        //   title: "联系我们",
        // },
      ],
    };
  },
  methods:{
    mouseOver(){
      this.Now = 2
    },
    mouseLeave() {
      this.Now = 1
      
    }
  }
};
</script>
<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
.white {
  background: #fff;
  background: rgba($color: #ffffff, $alpha: 0.8);
}

.notWhite {
  background: none;
}

li {
  list-style: none;
}
a {
  text-decoration: none;
  color: #333333;
}

.logoOne {
  background-position: -632px -38px;
}

.logoTwo {
  background-position: -127px -38px;
}

.MenuOne {
        background-position: -99px -945px;
}

.MenuTwo {
  background-position: -167px -945px
}
#headerOne {
  width: 100%;
  // background: yellowgreen;
  padding: 20px 0px;
  position: fixed;
  z-index: 999999999;
  .headerOne {
    // background: violet;
    width: 1200px;
    overflow: hidden;
    margin: 0 auto;
    .logo {
      float: left;
      a {
        width: 220px;
        height: 51px;
        line-height: 51px;
        margin-right: 80px;
        background-size: 1000px 1400px;
        // background-image: url(../../images/new_bg.svg);
        display: inline-block;
        background-repeat: no-repeat;
        background-image: url("../assets/new_bg.svg");
      }
    }
    .rightMenu {
      float: right;
      span {
        // font-weight: 700;
        font-size: 20px;
        color: #fff;
        line-height: 50px;
        padding-right: 20px;
      }
      i {
        // position: absolute;
        // top: 11px;
        // right: 11px;
        width: 30px;
        height: 33px;
        vertical-align: middle;
        background-size: 1000px 1400px;
        background-image: url("../assets/new_bg.svg");
        display: inline-block;
        background-repeat: no-repeat;
      }
    }
    .nav {
      margin-top: 20px;
      > ul {
        display: flex;
        justify-content: space-around;
        > li {
          width: 24%;
        }
        > li:last-child {
          width: 28%;
          border-left: 1px solid #333333;
          box-sizing: border-box;
          padding-left: 5%;
          span {
            display: block;
            color: #00bdda;
          }
        }
      }
      li {
        text-align: left;
        line-height: 34px;
      }
    }
  }
}
</style>